<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>BlackStar Monitor&amp;Profile System</title>
        <meta http-equiv="pragma" content="no-cache" />
        <link rel="stylesheet" type="text/css" href="/static/extjs/resources/css/ext-all.css" rel="stylesheet" />
        <script type="text/javascript" src="/static/extjs/adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="/static/extjs/ext-all.js"></script>    
        <script type="text/javascript" src="../js/help.js"></script>    
        <script type="text/javascript">
Ext.onReady(function(){
    Ext.QuickTips.init();
	Ext.form.Field.prototype.msgTarget = 'side';
	
    var jvmid = QueryString('jvmid');
    var monitor = QueryString('monitor');
    var name = QueryString('name');
    var performance = QueryString('performance');
    var param = 'jvmid=' + jvmid + '&name=' + name + '&refresh=' + new Date().getTime()
	var items = new Array();
	items[0] = {
		id : 'overview',
    	title : 'VM摘要',
		html : "<iframe id='ovewviewFrame' width='98%' height='95%' frameborder='0' scrolling='no' src='overview.html?jvmid=" + jvmid +  "&refresh=" + new Date().getTime() + "'></iframe>"
	};
	items[1] = {
		id : 'thread',
    	title : '线程',
    	html: "<iframe id='threadFrame' width='98%' height='95%' frameborder='0' scrolling='no'></iframe>",
    	refresh : function() {
			var frame = document.getElementById('threadFrame');
			if (frame.src == '')
			{
				frame.src = "thread.html?jvmid=" + jvmid +  "&refresh=" + new Date().getTime();
			}
		}
	};
	
	if ('true' == monitor && name && name != '')
	{
		items[2] = {
			id : 'monitor',
    		title : '监控',
    		html:  "<iframe id='monitorFrame' width='98%' height='95%' frameborder='0' scrolling='no'></iframe>",
    		refresh : function() {
				var frame = document.getElementById('monitorFrame');
				if (frame.src == '')
				{
					frame.src = "monitor.html?jvmid=" + jvmid + "&name=" + name + "&refresh=" + new Date().getTime();
				}
			}
		};
		
		if ('true' == performance)
		{
			items[3] = {
				id : 'performanceStat',
    			title : '性能统计',
    			html: "<iframe id='performanceStatFrame' width='98%' height='95%' frameborder='0' scrolling='no'></iframe>",
    			refresh : function() {
					var frame = document.getElementById('performanceStatFrame');
					if (frame.src == '')
					{
						frame.src = "performance-stat.html?jvmid=" + jvmid + "&name=" + name + "&refresh=" + new Date().getTime();
					}
				}
			};
			items[4] = {
				id : 'performanceAgent',
    			title : '性能Agent',
    			html: "<iframe id='performanceAgentFrame' width='98%' height='95%' frameborder='0' scrolling='no'></iframe>",
    			refresh : function() {
					var frame = document.getElementById('performanceAgentFrame');
					if (frame.src == '')
					{
						frame.src = "performance-agent.html?jvmid=" + jvmid + "&name=" + name + "&refresh=" + new Date().getTime();
					}
				}
			};
		}
	}
	
	var mainPanel = new Ext.TabPanel({
		renderTo: document.body,
        activeTab: 0,
        width:'100%',
		height: '100%',
        plain:true,
        defaults:{autoScroll: true},
        items:items
    });
    mainPanel.on('tabchange', function(panel, tab) {
    	tab.refresh();
		panel.doLayout();
	});
});
        </script>
    </head>
    <body style="padding: 10px;"></body>
</html>